<div class="page-breadcrumbs">
    <ul class="breadcrumb">
        <li>
            <i class="fa fa-home"></i>
            <a href="#">Home</a>
        </li>
        <li>
            <a href="#">系统设置</a>
        </li>
        <li>
            <a href="#!system/role/role-index.html">角色管理</a>
        </li>
        <li class="active">角色所属菜单</li>
    </ul>
</div>
<div class="page-body">

    <div class="row">
        <div class="col-lg-4 col-sm-12 col-xs-12">
            <div class="widget">
                <div class="widget-header bordered-bottom bordered-themeprimary">
                    <i class="widget-icon fa fa-tasks themeprimary"></i>
                    <span class="widget-caption themeprimary">菜单选择</span>
                </div>
                <div class="widget-body">
                    <div class="widget-main no-padding">
                        <ul id="menuTree" class="row ztree"></ul>
                    </div>
                </div>
            </div>

        </div>
        <div class="col-lg-8 col-sm-12 col-xs-12">
            <div class="row">
                <div class="col-lg-12">
                    <div class="widget">
                        <div class="widget-header bordered-bottom bordered-themesecondary">
                            <i class="widget-icon fa fa-tags themesecondary"></i>
                            <span class="widget-caption themesecondary">已选择菜单</span>
                        </div><!--Widget Header-->
                        <div class="widget-body">
                            <div class="widget-main no-padding">
                                <div class="tickets-container">
                                    <ul class="tickets-list">
                                        <li class="ticket-item">
                                            <div class="row">
                                                <div class="ticket-user col-lg-6 col-sm-12">
                                                    <img src="assets/img/avatars/adam-jansen.jpg" class="user-avatar">
                                                    <span class="user-name">Adam Johnson</span>
                                                    <span class="user-at">at</span>
                                                    <span class="user-company">Microsoft</span>
                                                </div>
                                                <div class="ticket-time  col-lg-4 col-sm-6 col-xs-12">
                                                    <div class="divider hidden-md hidden-sm hidden-xs"></div>
                                                    <i class="fa fa-clock-o"></i>
                                                    <span class="time">1 Hours Ago</span>
                                                </div>
                                                <div class="ticket-type  col-lg-2 col-sm-6 col-xs-12">
                                                    <span class="divider hidden-xs"></span>
                                                    <span class="type">Issue</span>
                                                </div>
                                                <div class="ticket-state bg-palegreen">
                                                    <i class="fa fa-check"></i>
                                                </div>
                                            </div>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>


        </div>
    </div>

</div>
<script type="application/javascript">
    var selectTreeNode = null;
    var setting = {
        async: {
            enable: true,
            url:"rest/v1/sys/menu/BASE_DATA_MANAGE/childs",
            autoParam:["id=parenId"],
            dataType: "json",
            type: "get",
            dataFilter: filter
        },
        callback: {
            beforeClick: beforeClick
        }
    };

    function filter(treeId, parentNode, childNodes) {
        if (!childNodes) return null;
        for (var i=0, l=childNodes.length; i<l; i++) {
            childNodes[i].name = childNodes[i].name.replace(/\.n/g, '.');
        }
        return childNodes;
    }

    function beforeClick(treeId, treeNode) {
        selectTreeNode = treeNode;
    }

    $(function(){
        $.fn.zTree.init($("#menuTree"), setting);
    });
</script>